package main

import (
	"gitee.com/hust-ideas/little-genius-backend/config"
	model "gitee.com/hust-ideas/little-genius-backend/dal/db"
	"gitee.com/hust-ideas/little-genius-backend/dal/redis"
	"gitee.com/hust-ideas/little-genius-backend/router"
	"gitee.com/hust-ideas/little-genius-backend/service"
)

// entry point
func main() {
	// load config
	// config := config.InitConfig()
	// redis := redis.InitRedis(*config)
	// ser := service.NewServiceContext(*config, redis)
	config := config.InitConfig()
	m := model.InitDB(*config)
	var redisClient redis.RedisClientInterface = redis.InitRedis(*config)
	ser := service.NewServiceContext(*config, m, &redisClient)

	router := router.NewRouter(ser)
	router.Run(config.Server.Port)
}
